package com.xdb.sqlparser.dialect.oracle.ast.statement;

import java.util.ArrayList;
import java.util.List;

import com.xdb.sqlparser.ast.SQLHint;
import com.xdb.sqlparser.ast.statement.SQLDeleteStatement;
import com.xdb.sqlparser.dialect.oracle.ast.clause.OracleReturningClause;
import com.xdb.sqlparser.dialect.oracle.visitor.OracleASTVisitor;
import com.xdb.sqlparser.visitor.SQLAstVisitor;
import com.xdb.util.JDBCConstants;

public class OracleDeleteStatement extends SQLDeleteStatement {

	private boolean only = false;

	private final List<SQLHint> hints = new ArrayList<SQLHint>();
	private OracleReturningClause returning = null;

	public OracleDeleteStatement() {
		super(JDBCConstants.ORACLE);
	}

	public OracleReturningClause getReturning() {
		return returning;
	}

	public void setReturning(OracleReturningClause returning) {
		this.returning = returning;
	}

	public List<SQLHint> getHints() {
		return this.hints;
	}

	protected void accept0(SQLAstVisitor visitor) {
		accept0((OracleASTVisitor) visitor);
	}

	protected void accept0(OracleASTVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, this.hints);
			acceptChild(visitor, this.tableSource);
			acceptChild(visitor, this.getWhere());
			acceptChild(visitor, returning);
		}

		visitor.endVisit(this);
	}

	public boolean isOnly() {
		return this.only;
	}

	public void setOnly(boolean only) {
		this.only = only;
	}

}
